import uasyncio as asyncio
from device_manager import DeviceManager
                                                                                              

UART_LCD_TX = 16
UART_LCD_RX = 17
ENCODER_A = 4
ENCODER_B = 2
ENCODER_KEY = 15
KEYBOARD_SLK = 12
KEYBOARD_DIO = 13
IIC_SCL = 22
IIC_SDA = 21
POWER_CTL = 23      
UART_POWER_TX = 18
UART_POWER_RX = 19


dmr = DeviceManager(UART_LCD_TX, UART_LCD_RX, ENCODER_A, ENCODER_B, ENCODER_KEY, KEYBOARD_SLK, KEYBOARD_DIO,
                    IIC_SCL, IIC_SDA, POWER_CTL, UART_POWER_TX, UART_POWER_RX)

def main():
    try:
        asyncio.run(loop())
    except KeyboardInterrupt:
        print('Interrupted')
    finally:
        asyncio.new_event_loop()

async def loop():
    while True:
        await asyncio.sleep(1)

if __name__ == "__main__":
    main()